<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@ page session="true" %>
    <%@ page import="java.util.Map,java.util.HashMap,java.util.List,com.gri.entities.*,java.util.ArrayList" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Project Detail</title>
<script type="text/javascript">
function submitForm(projectId, custId)
{
	
	if(projectId){
		document.createProject.submit();
	} else {
		document.createProject.submit();	
	}
	
  
}

</script>

</head>
<body style="width:90%; text-align: center;float: right;">
<%
	List<Project> projectList = (List<Project>)session.getAttribute("projectList");
	if(projectList == null){
		projectList = new ArrayList<Project>();
	}

%>

	<jsp:include page="../facelets/image.jsp"></jsp:include>
	
	<jsp:include page="../facelets/logout.jsp"></jsp:include>
	
	<div style="height:300px;font-family: verdana; font-size:13px; width:75%;">
		
		<div style="text-align: left;padding-top: 10px;">
		<table>
			<tr>
				<td>
					<p>You can create a new project by providing us the required data. 
					And then start pointing to day-to-day positioning of your website.</p>
					Click here to <a href="create_project.jsp?custId=<%= (String)session.getAttribute("custId")%>" id="createProject">Create Project</a>
				</td>
			</tr>
		</table>
		</br>
		<table>
			<tr>
				<td width="10%">
				</td>
				<td width="90%">
					<b><%= (String)request.getSession().getAttribute("userName") %></b>, &nbsp;your existing projects are:
				</td>
			</tr>
			<% if(projectList.isEmpty()){
			%>
			<tr>
				<td width="10%">
				</td>
				<td width="90%">
				<h6>You don't have any project</h6>
				</td>
			</tr>
			<%	
			}
			int count = 1;
			//request.setAttribute("isloggedIn", "true");
			for (Project project : projectList) {
	        %>
	        <tr>
	        	<td width="10%">
	        		<%= count %>
	        	</td>
	        	<td width="90%" style="border: 1px solid black;">
	        		<a href="projectDetail.jsp?proId=<%= project.getProjectId() %>" id="link<%=count%>"><%= project.getProjectName() %></a>
		        </td>
			</tr>
			<%
			count++;
			}
			%>
		</table>
		</div>
	</div>
	
	<jsp:include page="../facelets/footer.jsp"></jsp:include>
	<!-- <a href="user/create_project.jsp" id="createProject">Create Project</a> -->
</body>
</html>